/*
 * Copyright 2021 Muii
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.gitee.muii.echarts;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import com.alibaba.fastjson.JSON;
import com.gitee.mysmlz.echarts.options.series.SeriesLine;
import com.gitee.mysmlz.echarts.options.series.SeriesLine.MarkPoint;

class SeriesLineTest {

    @Test
    void test() {
        SeriesLine seriesLine = new SeriesLine();
        Assertions.assertEquals("line", seriesLine.getType());
        seriesLine.setData(new Double[]{1.0D, 2.0D});
        System.out.println(seriesLine);
        soutJson(seriesLine);
        seriesLine.setData(new String[]{"2", "3"});
        soutJson(seriesLine);
        String[][] strings = new String[1][];
        strings[0] = new String[]{"1", "2"};
        seriesLine.setData(strings);
        soutJson(seriesLine);
        seriesLine.setSmooth(true);
        soutJson(seriesLine);
        MarkPoint markPoint = new MarkPoint();
        markPoint.setSymbolRotate(1.0D);
        seriesLine.setMarkPoint(markPoint);
        soutJson(seriesLine);
    }

    void soutJson(SeriesLine seriesLine){
        System.out.println("----------------");
        System.out.println(JSON.toJSONString(seriesLine));
        System.out.println("..............................");
        System.out.println(JsonMapper.toJsonString(seriesLine));
    }

}
